package com.eastseeway.radioproject.database;


import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Transaction;

import com.eastseeway.radioproject.entities.BeanOfElectrode;
import com.rabbitmq.client.AMQP;

import java.util.List;

@Dao
public interface ElectrodeDao {

    @Insert
    @Transaction
    void addElectrode(List<BeanOfElectrode> beanOfElectrodes);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void addElectrode(BeanOfElectrode beanOfElectrode);

//    根据升温目标，电极类型和刺入深度和最大功率查询作用时长
    @Query("select duration from beanofelectrode where targetTemp = :targetTemp and number = :number and depth = :depth and power = :power")
    float queryElectrode(float targetTemp,float number,float depth ,float power);

    @Query("delete from beanofelectrode")
    int deleteAll();

    @Query("select * from beanofelectrode")
    List<BeanOfElectrode> queryAll();

}
